<div class="layui-fluid nepadmin-pad0 nepadmin-mar0 list0" id="drawingsset" lay-title="提款设置">
  <div class="layui-fluid layui-form">
    <div class="layui-row layui-col-space15">
      <div class="layui-col-md12">
        <div class="layui-card">
		  <div class="layui-card-header">提款设置</div>
          <div class="layui-card-body hxr-card-body" style="padding: 15px;">
			<div class="layui-form-item verify">
			  <label class="layui-form-label">单笔提款最小金额(元)</label>
			  <div class="layui-input-block layui-input-inline">
				<input type="number" v-model="detail.value.min_money" autocomplete="off" verify="require|znum" class="layui-input" placeholder="请输入最小金额">
				<span class="hint">单笔提款最小金额必填</span>
			  </div>
			  <div class="layui-form-mid layui-word-aux">为0时不做限制</div>
			</div>
			<div class="layui-form-item verify">
			  <label class="layui-form-label">单笔提款最大金额(元)</label>
			  <div class="layui-input-block layui-input-inline">
				<input type="number" v-model="detail.value.max_money" autocomplete="off" verify="require|znum" class="layui-input" placeholder="请输入最大金额">
				<span class="hint">单笔提款最大金额必填</span>
			  </div>
			  <div class="layui-form-mid layui-word-aux">为0时不做限制</div>
			</div>
			<div class="layui-form-item verify">
			  <label class="layui-form-label">当日提款总金额(元)</label>
			  <div class="layui-input-block layui-input-inline">
				<input type="number" v-model="detail.value.count_money" autocomplete="off" verify="require|znum" class="layui-input" placeholder="请输入总金额">
				<span class="hint">当日提款总金额必填</span>
			  </div>
			  <div class="layui-form-mid layui-word-aux">为0时不做限制</div>
			</div>
			<div class="layui-form-item verify">
			  <label class="layui-form-label">当日提款总次数</label>
			  <div class="layui-input-block layui-input-inline">
				<input type="number" v-model="detail.value.count_num" autocomplete="off" verify="require|znum" class="layui-input" placeholder="请输入总次数">
				<span class="hint">当日提款总次数必填</span>
			  </div>
			  <div class="layui-form-mid layui-word-aux">为0时不做限制</div>
			</div>
			<div class="layui-form-item verify">
			  <label class="layui-form-label">单笔提款手续费(元)</label>
			  <div class="layui-input-block layui-input-inline">
				<input type="number" v-model="detail.value.fee" autocomplete="off" verify="require|znum" class="layui-input" placeholder="请输入手续费">
				<span class="hint">单笔提款手续费必填</span>
			  </div>
			</div>
			<div class="layui-form-item">
			  <label class="layui-form-label">是否启用</label>
			  <div class="layui-input-inline">
				 <div class="layui-unselect layui-form-switch" :class="{'layui-form-onswitch':detail.status==1}" lay-skin="_switch" @click="radioF()"><em>{{detail.status==1?'启用':'停用'}}</em><i></i></div>
			  </div>
			</div>
			<div class="layui-form-item">
			  <label class="layui-form-label"></label>
			  <div class="layui-input-inline">
				<button type="button" class="layui-btn" style="width: 190px;" @click="submit">保存</button>
			  </div>
			</div>
          </div>
        </div>
      </div>
    </div>
  </div>
</div>
<style type="text/css">
#drawingsset .layui-form-label{
	width: 150px;
}
#drawingsset .layui-input-block{
	margin-left:0;
}
</style>
<script>
	layui.use(['form'], function(){
	  var $ = layui.$
	  ,form = layui.form;
	  var vm=new Vue({
	  	  el:'#drawingsset',
	  	  data:{
	  		  detail:{
	  			 value:{}
	  		  },
	  		  full:'',
	  		  reduce:'',
	  		  old_detail:{}
	  	  },
	  	  mounted:function() {
			  //初始化
			var _this=this;

	  	  	layui.admin.ajax('withdraw/get_congfig_list',{},1).then(function(res){
				_this.detail=res.data,_this.old_detail=JSON.stringify(res.data);
	  	  	});
	  	  },
	  	  methods:{
	  		  radioF:function(){//radio选择
	  		  	this.detail.status==1?this.detail.status=2:this.detail.status=1;
	  		  },
			  submit:function(){
				  var _this=this;
				  if(layui.admin.form('#drawingsset')){
					  var data=layui.admin.filter(_this.detail,JSON.parse(_this.old_detail)),datas={};
					  if(data){
					  	datas=_this.detail.value;
					  	datas.status=_this.detail.status;
					  	layui.admin.ajax('withdraw/set_config',datas).then((res)=>{
					  		_this.old_detail=JSON.stringify(_this.detail);
					  	}).catch((res)=>{});
					  }else{
					  	layer.msg('无修改');
					  }
				  }
			  }
	  	  }
	  })
	})
</script>